﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Gfw.Web.Common
{
    public static class Params
    {
        private const string SelectedDepartmentId = "__selectdepartmentid";
        private const string SelectModuleGroupId = "__SELECTMODULEGROUPID";
        private const string SelectLogType = "__SELECTLOGTYPE";

        public static string DepartmentId
        {
            get { return HttpContext.Current.Session[SelectedDepartmentId].ConvertTo<string>(""); }
            set { HttpContext.Current.Session[SelectedDepartmentId] = value; }
        }

        public static string ModelGroupId
        {
            get { return HttpContext.Current.Session[SelectModuleGroupId].ConvertTo<string>(""); }
            set { HttpContext.Current.Session[SelectModuleGroupId] = value; }
        }

        public static string CurrentLogType
        {
            get { return HttpContext.Current.Session[SelectLogType].ConvertTo<string>(""); }
            set { HttpContext.Current.Session[SelectLogType] = value; }
        }

        #region 二级验证

        private const string SecondVerifyKey = "___SecurityVerify___";
        private const string SecondVerifyKeyTimeOut = "___SecurityVerify___timeout";
        public static bool SecondVerify
        {
            get { return HttpContext.Current.Session[SecondVerifyKey].ConvertTo<bool>(false); }
            set { HttpContext.Current.Session[SecondVerifyKey] = value; }
        }
        public static DateTime SecondVerifyTimeOut
        {
            get { return HttpContext.Current.Session[SecondVerifyKeyTimeOut].ConvertTo<DateTime>(DateTime.MinValue); }
            set { HttpContext.Current.Session[SecondVerifyKeyTimeOut] = value; }
        }


        #endregion
    }
}